package cn.wolfcode.luowowo.article.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import cn.wolfcode.luowowo.member.domain.UserInfo;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Setter
@Getter
public class ScenicDetail extends BaseDomain {

    public static final int STATE_NORMAL=0;//正常
    public static final int STATE_HOT=1;//热门
    public static final int STATE_FORBID=2;//禁止

    private String name;//广州塔

    private String pingyin;//拼音

    private Long dest_id;//目的地id

    private String coverUrl;//封面
    private List<String> coverUrls = new ArrayList<>();

    private String info;//简介

    private ScenicTheme theme;//主题

    private UserInfo userInfo;//用户

    private Long remarkId;//点评Id

    private String wheather;//天气

    private String phone;//手机

    private String URL;//网址

    private int needTime;//需要时间

    private String traffic;//交通

    private String tickets;//门票

    private String openTime;//开放时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;//创建时间

    private String tip;//提示

    private Integer goToNum;//去过数

    private Integer replynum;//点评数

    private Integer favornum;//收藏数

    private Integer state=STATE_NORMAL;//状态

    private Integer thumbsupnum;//点赞数

    private Integer viewnum;//阅读数

    private List<ScenicTag> tags = new ArrayList<>();

    //添加编辑时，前端传入是long数组， 数据库保存的是id拼接的字符串
//    public String getCoverUrl(){
//        //id1,id2,id3
//        return StringUtils.join(coverUrls, ",");
//    }
}